package org.bigjava.user.web.config;


import org.bigjava.common.Constant;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UserInterceptor implements HandlerInterceptor {
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//        Object userId = request.getSession().getAttribute(Constant.login);
//
//        if (userId == null) {
//            request.setAttribute("msg", "请先登录");
//            request.getRequestDispatcher("/login").forward(request, response);
//            return false;
//        } else {
//            return true;
//        }
//
//    }
}
